Optimal. Leaf size=180 \[ \frac {1}{8} \left (6 a A b+3 a^2 B+4 b^2 B\right ) x+\frac {\left (4 a^2 A+5 A b^2+10 a b B\right ) \sin (c+d x)}{5 d}+\frac {\left (6 a A b+3 a^2 B+4 b^2 B\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a (2 A b+a B) \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {a^2 A \cos ^4(c+d x) \sin (c+d x)}{5 d}-\frac {\left (4 a^2 A+5 A b^2+10 a b B\right ) \sin ^3(c+d x)}{15 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.19, antiderivative size = 180, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {4109, 4132,
2713, 4130, 2715, 8} \begin {gather*} -\frac {\left (4 a^2 A+10 a b B+5 A b^2\right ) \sin ^3(c+d x)}{15 d}+\frac {\left (4 a^2 A+10 a b B+5 A b^2\right ) \sin (c+d x)}{5 d}+\frac {\left (3 a^2 B+6 a A b+4 b^2 B\right ) \sin (c+d x) \cos (c+d x)}{8 d}+\frac {1}{8} x \left (3 a^2 B+6 a A b+4 b^2 B\right )+\frac {a^2 A \sin (c+d x) \cos ^4(c+d x)}{5 d}+\frac {a (a B+2 A b) \sin (c+d x) \cos ^3(c+d x)}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2713
Rule 2715
Rule 4109
Rule 4130
Rule 4132
Rubi steps
\begin {align*} \int \cos ^5(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx &=\frac {a^2 A \cos ^4(c+d x) \sin (c+d x)}{5 d}-\frac {1}{5} \int \cos ^4(c+d x) \left (-5 a (2 A b+a B)+\left (A \left (-4 a^2-5 b^2\right )-10 a b B\right ) \sec (c+d x)-5 b^2 B \sec ^2(c+d x)\right ) \, dx\\ &=\frac {a^2 A \cos ^4(c+d x) \sin (c+d x)}{5 d}-\frac {1}{5} \int \cos ^4(c+d x) \left (-5 a (2 A b+a B)-5 b^2 B \sec ^2(c+d x)\right ) \, dx-\frac {1}{5} \left (-4 a^2 A-5 A b^2-10 a b B\right ) \int \cos ^3(c+d x) \, dx\\ &=\frac {a (2 A b+a B) \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {a^2 A \cos ^4(c+d x) \sin (c+d x)}{5 d}-\frac {1}{4} \left (-6 a A b-3 a^2 B-4 b^2 B\right ) \int \cos ^2(c+d x) \, dx-\frac {\left (4 a^2 A+5 A b^2+10 a b B\right ) \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{5 d}\\ &=\frac {\left (4 a^2 A+5 A b^2+10 a b B\right ) \sin (c+d x)}{5 d}+\frac {\left (6 a A b+3 a^2 B+4 b^2 B\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a (2 A b+a B) \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {a^2 A \cos ^4(c+d x) \sin (c+d x)}{5 d}-\frac {\left (4 a^2 A+5 A b^2+10 a b B\right ) \sin ^3(c+d x)}{15 d}-\frac {1}{8} \left (-6 a A b-3 a^2 B-4 b^2 B\right ) \int 1 \, dx\\ &=\frac {1}{8} \left (6 a A b+3 a^2 B+4 b^2 B\right ) x+\frac {\left (4 a^2 A+5 A b^2+10 a b B\right ) \sin (c+d x)}{5 d}+\frac {\left (6 a A b+3 a^2 B+4 b^2 B\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a (2 A b+a B) \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {a^2 A \cos ^4(c+d x) \sin (c+d x)}{5 d}-\frac {\left (4 a^2 A+5 A b^2+10 a b B\right ) \sin ^3(c+d x)}{15 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.55, size = 146, normalized size = 0.81 \begin {gather*} \frac {60 \left (6 a A b+3 a^2 B+4 b^2 B\right ) (c+d x)+60 \left (5 a^2 A+6 A b^2+12 a b B\right ) \sin (c+d x)+120 \left (2 a A b+a^2 B+b^2 B\right ) \sin (2 (c+d x))+10 \left (5 a^2 A+4 A b^2+8 a b B\right ) \sin (3 (c+d x))+15 a (2 A b+a B) \sin (4 (c+d x))+6 a^2 A \sin (5 (c+d x))}{480 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.51, size = 184, normalized size = 1.02
method | result | size |
derivativedivides | \(\frac {\frac {a^{2} A \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+a^{2} B \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+2 A b a \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {2 B a b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+\frac {A \,b^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+b^{2} B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(184\) |
default | \(\frac {\frac {a^{2} A \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+a^{2} B \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+2 A b a \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {2 B a b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+\frac {A \,b^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+b^{2} B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(184\) |
risch | \(\frac {3 A a b x}{4}+\frac {3 B \,a^{2} x}{8}+\frac {x \,b^{2} B}{2}+\frac {5 a^{2} A \sin \left (d x +c \right )}{8 d}+\frac {3 \sin \left (d x +c \right ) A \,b^{2}}{4 d}+\frac {3 \sin \left (d x +c \right ) B a b}{2 d}+\frac {a^{2} A \sin \left (5 d x +5 c \right )}{80 d}+\frac {\sin \left (4 d x +4 c \right ) A b a}{16 d}+\frac {\sin \left (4 d x +4 c \right ) a^{2} B}{32 d}+\frac {5 a^{2} A \sin \left (3 d x +3 c \right )}{48 d}+\frac {\sin \left (3 d x +3 c \right ) A \,b^{2}}{12 d}+\frac {\sin \left (3 d x +3 c \right ) B a b}{6 d}+\frac {\sin \left (2 d x +2 c \right ) A b a}{2 d}+\frac {\sin \left (2 d x +2 c \right ) a^{2} B}{4 d}+\frac {\sin \left (2 d x +2 c \right ) b^{2} B}{4 d}\) | \(225\) |
norman | \(\frac {\left (\frac {3}{4} A b a +\frac {3}{8} a^{2} B +\frac {1}{2} b^{2} B \right ) x +\left (-\frac {15}{4} A b a -\frac {15}{8} a^{2} B -\frac {5}{2} b^{2} B \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {15}{4} A b a -\frac {15}{8} a^{2} B -\frac {5}{2} b^{2} B \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {3}{4} A b a +\frac {3}{8} a^{2} B +\frac {1}{2} b^{2} B \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {3}{4} A b a +\frac {3}{8} a^{2} B +\frac {1}{2} b^{2} B \right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {3}{4} A b a +\frac {3}{8} a^{2} B +\frac {1}{2} b^{2} B \right ) x \left (\tan ^{14}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {9}{4} A b a +\frac {9}{8} a^{2} B +\frac {3}{2} b^{2} B \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {9}{4} A b a +\frac {9}{8} a^{2} B +\frac {3}{2} b^{2} B \right ) x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {8 \left (19 a^{2} A +5 A \,b^{2}+10 B a b \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{15 d}-\frac {2 \left (2 a^{2} A -6 A b a -2 A \,b^{2}-3 a^{2} B -4 B a b \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {2 \left (2 a^{2} A +6 A b a -2 A \,b^{2}+3 a^{2} B -4 B a b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {\left (8 a^{2} A -10 A b a +8 A \,b^{2}-5 a^{2} B +16 B a b -4 b^{2} B \right ) \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {\left (8 a^{2} A +10 A b a +8 A \,b^{2}+5 a^{2} B +16 B a b +4 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (88 a^{2} A -10 A b a -40 A \,b^{2}-5 a^{2} B -80 B a b +60 b^{2} B \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{20 d}+\frac {\left (88 a^{2} A +10 A b a -40 A \,b^{2}+5 a^{2} B -80 B a b -60 b^{2} B \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{20 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}\) | \(596\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 176, normalized size = 0.98 \begin {gather*} \frac {32 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 10 \, \sin \left (d x + c\right )^{3} + 15 \, \sin \left (d x + c\right )\right )} A a^{2} + 15 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{2} + 30 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} A a b - 320 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a b - 160 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A b^{2} + 120 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B b^{2}}{480 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.91, size = 142, normalized size = 0.79 \begin {gather*} \frac {15 \, {\left (3 \, B a^{2} + 6 \, A a b + 4 \, B b^{2}\right )} d x + {\left (24 \, A a^{2} \cos \left (d x + c\right )^{4} + 30 \, {\left (B a^{2} + 2 \, A a b\right )} \cos \left (d x + c\right )^{3} + 64 \, A a^{2} + 160 \, B a b + 80 \, A b^{2} + 8 \, {\left (4 \, A a^{2} + 10 \, B a b + 5 \, A b^{2}\right )} \cos \left (d x + c\right )^{2} + 15 \, {\left (3 \, B a^{2} + 6 \, A a b + 4 \, B b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{120 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 487 vs.
\(2 (168) = 336\).
time = 0.50, size = 487, normalized size = 2.71 \begin {gather*} \frac {15 \, {\left (3 \, B a^{2} + 6 \, A a b + 4 \, B b^{2}\right )} {\left (d x + c\right )} + \frac {2 \, {\left (120 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 75 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 150 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 240 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 120 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 60 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 160 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 30 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 60 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 640 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 320 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 120 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 464 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 800 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 400 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 160 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 30 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 60 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 640 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 320 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 120 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 120 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 75 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 150 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 240 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 120 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 60 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{5}}}{120 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.81, size = 307, normalized size = 1.71 \begin {gather*} \frac {x\,\left (\frac {3\,B\,a^2}{4}+\frac {3\,A\,a\,b}{2}+B\,b^2\right )}{2}+\frac {\left (2\,A\,a^2+2\,A\,b^2-\frac {5\,B\,a^2}{4}-B\,b^2-\frac {5\,A\,a\,b}{2}+4\,B\,a\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (\frac {8\,A\,a^2}{3}+\frac {16\,A\,b^2}{3}-\frac {B\,a^2}{2}-2\,B\,b^2-A\,a\,b+\frac {32\,B\,a\,b}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {116\,A\,a^2}{15}+\frac {40\,B\,a\,b}{3}+\frac {20\,A\,b^2}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {8\,A\,a^2}{3}+\frac {16\,A\,b^2}{3}+\frac {B\,a^2}{2}+2\,B\,b^2+A\,a\,b+\frac {32\,B\,a\,b}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,A\,a^2+2\,A\,b^2+\frac {5\,B\,a^2}{4}+B\,b^2+\frac {5\,A\,a\,b}{2}+4\,B\,a\,b\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________